package utils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;

public class BasicFileWriter {

	BufferedWriter bufferedwriter;

	public BasicFileWriter(String filename) {
		try {
			bufferedwriter = new BufferedWriter(new java.io.FileWriter(
					new File(filename)));
		} catch (IOException e) {
			bufferedwriter = null;
		}
	}

	public void writeLine(String line) {

		if (bufferedwriter != null)
			try {
				bufferedwriter.write(line + "\n");
			} catch (IOException e) {
				e.printStackTrace();
			}
	}

	public void close() {
		if (bufferedwriter != null)
			try {
				bufferedwriter.close();
			} catch (IOException e) {
			}
	}
}
